import React, { useEffect, useState } from 'react';
import moment from 'moment';
moment.locale();

interface UserJoinSessionProps {
	time?: string;
	setStartMsgTime?: () => void;
}

const UserJoinSession = (props: UserJoinSessionProps) => {
	const { time } = props;

	const [formatTime, setFormatTime] = useState('');

	useEffect(() => {
		let date = moment(time).format('HH:mm');
		setFormatTime(date);
	}, [time]);
	return (
		<div className="time-container">
			<p className="time">{formatTime}</p>
		</div>
	);
};

export default UserJoinSession;
